package test.y2020;

import cn.hutool.core.lang.Console;
import cn.hutool.json.JSONUtil;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2020/11/12 15:29
 */
public class November1 {

    public static void main(String[] args) {

        int number = 99;

        List<Integer> collect =
                Stream.iterate(1, k -> ++k).limit(number).filter(k -> number % k == 0).collect(Collectors.toList());

        Console.error(collect);

        List<Integer> objects = new ArrayList<>();
        for (int i = 1; i <= number; i++) {
            if (number % i == 0) {
                objects.add(i);
            }
        }
        Console.error(objects);

        List<Integer> integers = Stream.iterate(1, i -> ++i).limit(3).map(i -> {
            Console.error(i);
            return i;
        }).collect(Collectors.toList());
        Console.error(JSONUtil.toJsonStr(integers));
    }
}
